/*
 * Simplified Chinese translation By DavidHu 09 April 2007
 */

Ext.UpdateManager.defaults.indicatorText = '<div class="loading-indicator">Loading...</div>';

if (Ext.View) {
	Ext.View.prototype.emptyText = "";
}

if (Ext.grid.Grid) {
	Ext.grid.Grid.prototype.ddText = "{0} please choose a row";
}

if (Ext.TabPanelItem) {
	Ext.TabPanelItem.prototype.closeText = "close";
}

if (Ext.form.Field) {
	Ext.form.Field.prototype.invalidText = "invalid";
}

Date.monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October",
		"November", "December"];

Date.dayNames = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];

if (Ext.MessageBox) {
	Ext.MessageBox.buttonText = {
		ok : "Save",
		cancel : "Return",
		yes : "Yes",
		no : "No"
	};
}

if (Ext.util.Format) {
	Ext.util.Format.date = function(v, format) {
		if (!v)
			return "";
		if (!(v instanceof Date))
			v = new Date(Date.parse(v));
		return v.dateFormat(format || "y.m.d");
	};
}

if (Ext.DatePicker) {
	Ext.apply(Ext.DatePicker.prototype, {
				todayText : "今天",
				minText : "日期在最小日期之前",
				maxText : "日期在最大日期之后",
				disabledDaysText : "",
				disabledDatesText : "",
				monthNames : Date.monthNames,
				dayNames : Date.dayNames,
				nextText : '下月 (Control+Right)',
				prevText : '上月 (Control+Left)',
				monthYearText : '选择一个月 (Control+Up/Down 来改变年)',
				todayTip : "{0} (空格键选择)",
				format : "y年m月d日"
			});
}

if (Ext.PagingToolbar) {
	Ext.apply(Ext.PagingToolbar.prototype, {
				beforePageText : "Page",
				afterPageText : "total {0} Page(s)",
				firstText : "page 1",
				prevText : "prevPage",
				nextText : "nextPage",
				lastText : "lasePage",
				refreshText : "Refresh",
				displayMsg : "Displaying {0} - {1} of {2}",
				emptyMsg : 'No data to display'
			});
}

if (Ext.form.TextField) {
	Ext.apply(Ext.form.TextField.prototype, {
				minLengthText : "the minimum length of the input is {0}",
				maxLengthText : "the maximum length of the input is {0}",
				blankText : "please input",
				regexText : "",
				emptyText : null
			});
}

if (Ext.form.NumberField) {
	Ext.apply(Ext.form.NumberField.prototype, {
				minText : "the minimum value of the input is  {0}",
				maxText : "the maximum value of the input is  {0}",
				nanText : "{0} is not a valid value"
			});
}

if (Ext.form.DateField) {
	Ext.apply(Ext.form.DateField.prototype, {
				disabledDaysText : "禁用",
				disabledDatesText : "禁用",
				minText : "该输入项的日期必须在 {0} 之后",
				maxText : "该输入项的日期必须在 {0} 之前",
				invalidText : "{0} 是无效的日期 - 必须符合格式： {1}",
				format : "y年m月d日"
			});
}

if (Ext.form.ComboBox) {
	Ext.apply(Ext.form.ComboBox.prototype, {
				loadingText : "Loading...",
				valueNotFoundText : undefined
			});
}

if (Ext.form.VTypes) {
	Ext.apply(Ext.form.VTypes, {
				emailText : '该输入项必须是电子邮件地址，格式如： "user@domain.com"',
				urlText : '该输入项必须是URL地址，格式如： "http:/' + '/www.domain.com"',
				alphaText : '该输入项只能包含字符和_',
				alphanumText : '该输入项只能包含字符,数字和_'
			});
}

if (Ext.grid.GridView) {
	Ext.apply(Ext.grid.GridView.prototype, {
				sortAscText : "positive sequence",
				sortDescText : "negative sequence",
				lockText : "lock",
				unlockText : "unlock",
				columnsText : "column"
			});
}

if (Ext.grid.PropertyColumnModel) {
	Ext.apply(Ext.grid.PropertyColumnModel.prototype, {
				nameText : "name",
				valueText : "value",
				dateFormat : "y.m.d."
			});
}

if (Ext.layout.BorderLayout.SplitRegion) {
	Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, {
				splitTip : "Drag to change size.",
				collapsibleSplitTip : "Drag to change size. Double click to hide."
			});
}
